package ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FindJpanel extends JPanel implements ActionListener {
    private JButton btnFind;
    private JButton btnOff;
    private ATMJframe atmJframe;

    private Icon buttonFind = Util.getimagesIcon("/images/buttonFind.jpg");
    private Icon buttonOff = Util.getimagesIcon("/images/buttonOff.jpg");

    public FindJpanel(ATMJframe atmJframe) {
        this.atmJframe = atmJframe;

        this.setLayout(null);
        this.setOpaque(false);
        btnFind = new JButton("", buttonFind);
        btnFind.setBounds(200, 550, 140, 50);
        this.add(btnFind);
        btnOff = new JButton("", buttonOff);
        btnOff.setBounds(850, 550, 140, 50);
        this.add(btnOff);
        btnOff.addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==btnOff){
            atmJframe.switchPanel("menu");
        }
    }
}
